import Taro, { Component } from '@tarojs/taro'
import { View, Image } from '@tarojs/components'
import { DItemError } from '@/components'
import './itemImages.scss'

const carRunWord = require('../assets/imgdemo/hetong.png')//代购车辆采购合同
const payPath = require('../assets/imgdemo/lujing.png') // 付款路径
const payMoneyRecord = require('../assets/imgdemo/dingjin.png') // 订金支付凭证
const pressRecord = require('../assets/imgdemo/anjie.jpg') // 按揭凭证
const fuWu = require('../assets/imgdemo/anjie.jpg') // 车辆代购助购服务协议
const carOut = require('../assets/imgdemo/carout.jpg')
const carInside = require('../assets/imgdemo/carinside.jpg')
const carInfo = require('../assets/imgdemo/carinfo.jpeg')
const carJion = require('../assets/imgdemo/jiaojie.png')
const payInfo = require('../assets/imgdemo/fukuan.png')
const carRunRecord = require('../assets/imgdemo/xingshi.png')//车辆行驶证
const carInsure = require('../assets/imgdemo/cheliangbaoxian.png')//机动车辆保险证
const enterPrise = require('../assets/imgdemo/enterprise.png')
const carSuccess = require('../assets/imgdemo/carsuccess.png')
const carRun = require('../assets/imgdemo/sijixingshi.png')//司机驾驶证
const cheCai = require('../assets/imgdemo/caigouhetong.png')//车辆采购合同9
const yunshu = require('../assets/imgdemo/yunshuhetong.png')//车辆运输合同
const chejiao = require('../assets/imgdemo/jiaojiepinzheng.png')//车辆交接凭证

export default class ItemImages extends Component {

    render() {
        const { status = '' } = this.$router.params
        const getImageKey = (status) => {
            return {
                $yunshu:yunshu,
                $chejiao:chejiao,
                $checai:cheCai,
                $carrunword: carRunWord,
                $paypath: payPath,
                $paymoneyrecord: payMoneyRecord,
                $pressrecord: pressRecord,
                $fuwu: fuWu,
                $carout: carOut,
                $carinside: carInside,
                $carinfo: carInfo,
                $carjion: carJion,
                $payinfo: payInfo,
                $carrunrecord: carRunRecord,
                $carinsure: carInsure,
                $enterprise: enterPrise,
                $carsuccess: carSuccess,
                $carrun: carRun
            }[`$${status}`]
        }
		console.log("getImageKey(status)",getImageKey(status))
        return (
            status ? <View className='b_itemimages' >
                <Image src={getImageKey(status)} className='b_itemimages--item' aspectFit></Image>
            </View> : <DItemError type='9'></DItemError>
        )
    }
}
